﻿#define _CRT_SECURE_NO_WARNINGS 1
#include "my_map.h"
#include "my_set.h"

int main()
{
	wxd::set<int> s1;
	s1.Insert(3);
	s1.Insert(4);
	s1.Insert(5);
	s1.Insert(2);
	s1.Insert(1);

	wxd::set<int>::iterator it = s1.begin();
	//*it += 1;
	while (it != s1.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	//测试反向遍历
	auto rit = s1.end();
	while (rit != s1.begin())
	{
			--rit;
		cout << *rit << " ";
	}
	cout << endl;

	//测试map
	wxd::map<string, string> dict;
	dict.Insert({ "insert","插入" });
	dict.Insert({ "sort","排序" });
	dict.Insert({ "string","字符串" });
	dict.Insert({"test","测试"});
	for (auto& x : dict)
	{
		
		cout << x.first << ":" << x.second << endl;
	}
	wxd::map<string, string>::iterator dit = dict.begin();
	while (dit != dict.end())
	{
		// 不能修改first，可以修改second
		//dit->first += 'x';
		dit->second += 'x';

		cout << dit->first << ":" << iditt->second << endl;
		++it;
	}

	return 0;
}